package com.sogou.qadev.service.login.client.randomkey;

public class RandomKeyProxy implements com.sogou.qadev.service.login.client.randomkey.RandomKey {
  private String _endpoint = null;
  private com.sogou.qadev.service.login.client.randomkey.RandomKey randomKey = null;
  
  public RandomKeyProxy() {
    _initRandomKeyProxy();
  }
  
  private void _initRandomKeyProxy() {
    try {
      randomKey = (new com.sogou.qadev.service.login.client.randomkey.RandomKeyServiceLocator()).getRandomKey();
      if (randomKey != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)randomKey)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)randomKey)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (randomKey != null)
      ((javax.xml.rpc.Stub)randomKey)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.sogou.qadev.service.login.client.randomkey.RandomKey getRandomKey() {
    if (randomKey == null)
      _initRandomKeyProxy();
    return randomKey;
  }
  
  public com.sogou.qadev.service.login.bean.Key getKey(long keyID) throws java.rmi.RemoteException{
    if (randomKey == null)
      _initRandomKeyProxy();
    return randomKey.getKey(keyID);
  }
  
  public java.lang.String getKeyId(long productID, com.sogou.qadev.service.login.bean.DataAndEventId[] dataAndEvent, java.lang.String url, java.lang.String keyIDParamName, int maxRetryTimes, java.lang.String loginUrlPrefix) throws java.rmi.RemoteException{
    if (randomKey == null)
      _initRandomKeyProxy();
    return randomKey.getKeyId(productID, dataAndEvent, url, keyIDParamName, maxRetryTimes, loginUrlPrefix);
  }
  
  public void destroyKey(long keyID) throws java.rmi.RemoteException{
    if (randomKey == null)
      _initRandomKeyProxy();
    randomKey.destroyKey(keyID);
  }
  
  public void destroySession(java.lang.String sessionId) throws java.rmi.RemoteException{
    if (randomKey == null)
      _initRandomKeyProxy();
    randomKey.destroySession(sessionId);
  }
  
  
}